﻿package mortal.game.view.copy.towerCopy.cellrender
{
    import Message.Public.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.display.*;
    import mortal.common.global.*;
    import mortal.game.view.common.*;

    public class TowerRankListCellRenderer extends GCellRenderer
    {
        private var _txtLayer:GTextFiled;
        private var _txtPlayer:GTextFiled;
        private var _txtHonor:GTextFiled;

        public function TowerRankListCellRenderer()
        {
            var _loc_1:* = new Bitmap(new BitmapData(1, 1, true, 0));
            this.setStyle("downSkin", _loc_1);
            this.setStyle("overSkin", _loc_1);
            this.setStyle("upSkin", _loc_1);
            this.setStyle("selectedDownSkin", _loc_1);
            this.setStyle("selectedOverSkin", _loc_1);
            this.setStyle("selectedUpSkin", _loc_1);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildren();
            this._txtLayer = UIFactory.gTextField("" + Language.getString(70993), 23, 0, 220, 20, this, GlobalStyle.textFormatBai);
            this._txtPlayer = UIFactory.gTextField("" + Language.getString(70994), 90, 0, 220, 20, this, GlobalStyle.textFormatBai);
            this._txtHonor = UIFactory.gTextField("" + Language.getString(70995), 190, 0, 220, 20, this, GlobalStyle.textFormatBai);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._txtLayer.dispose(param1);
            this._txtPlayer.dispose(param1);
            this._txtHonor.dispose(param1);
            this._txtLayer = null;
            this._txtPlayer = null;
            this._txtHonor = null;
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as STowerPlayer;
            switch(_loc_2.rank)
            {
                case 1:
                {
                    var _loc_3:* = GlobalStyle.textFormatHong;
                    this._txtHonor.defaultTextFormat = GlobalStyle.textFormatHong;
                    var _loc_3:* = _loc_3;
                    this._txtPlayer.defaultTextFormat = _loc_3;
                    this._txtLayer.defaultTextFormat = _loc_3;
                    break;
                }
                case 2:
                {
                    var _loc_3:* = GlobalStyle.textFormatItemBlue;
                    this._txtHonor.defaultTextFormat = GlobalStyle.textFormatItemBlue;
                    var _loc_3:* = _loc_3;
                    this._txtPlayer.defaultTextFormat = _loc_3;
                    this._txtLayer.defaultTextFormat = _loc_3;
                    break;
                }
                case 3:
                {
                    var _loc_3:* = GlobalStyle.textFormatLv;
                    this._txtHonor.defaultTextFormat = GlobalStyle.textFormatLv;
                    var _loc_3:* = _loc_3;
                    this._txtPlayer.defaultTextFormat = _loc_3;
                    this._txtLayer.defaultTextFormat = _loc_3;
                    break;
                }
                default:
                {
                    var _loc_3:* = GlobalStyle.textFormatBai;
                    this._txtHonor.defaultTextFormat = GlobalStyle.textFormatBai;
                    var _loc_3:* = _loc_3;
                    this._txtPlayer.defaultTextFormat = _loc_3;
                    this._txtLayer.defaultTextFormat = _loc_3;
                    break;
                    break;
                }
            }
            this._txtLayer.text = _loc_2.level + "";
            this._txtPlayer.text = _loc_2.playerName;
            this._txtHonor.text = _loc_2.title;
            return;
        }// end function

    }
}
